<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>审批请假单</title>

    <!-- Bootstrap -->
    <link th:href="@{/bootstrap/css/bootstrap.css}" rel="stylesheet">
    <link th:href="@{/css/content.css}" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
</head>
<body>

<!--路径导航-->
<ol class="breadcrumb breadcrumb_nav">
    <li>首页</li>
    <li>请假管理</li>
    <li class="active">审批请假单</li>
</ol>
<!--路径导航-->

<div class="page-content">
    <div class="panel panel-default">
        <div class="panel-heading">请假申请单</div>
        <div class="panel-body">
            <form th:action="@{|/leavebill/submitTask|}" method="post">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-md-8">
                            <input type="hidden" name="id" th:value="${leavebill.id}"/>
                            <div th:if="${#strings.isEmpty(isCheck)}">
                                <input type="hidden" name="taskId" th:value="${task.id}"/>
                            </div>
                            <div th:unless="${#strings.isEmpty(isCheck)}">

                            </div>

                            <div class="form-group">
                                <label>标题</label>
                                <input type="text" class="form-control" id="content" readonly="readonly" name="content"
                                       th:value="${leavebill.content}">
                            </div>

                            <div class="form-group">
                                <label for="col_name">天数</label>
                                <input type="text" class="form-control" id="days" name="days" readonly="readonly"
                                       th:value="${leavebill.days}">
                            </div>

                            <div class="form-group">
                                <label for="col_name">请假开始时间</label>
                                <input type="text" class="form-control" id="leaveDate" name="leaveDate"
                                       readonly="readonly"
                                       th:value="${#dates.format(leavebill.leaveDate,'yyyy-MM-dd HH:mm:ss')}">
                            </div>

                            <div class="form-group">
                                <label for="seo_title">申请事由</label>
                                <textarea class="form-control" rows="10" cols="10" id="remark" readonly="readonly"
                                          th:utext="${leavebill.remark}" name="remark">${leavebill.remark}</textarea>
                            </div>
                            <div th:if="${#strings.isEmpty(isCheck)}">
                                <!--如果isCheck为null,说明不只是展示数据,还需要审批处理-->
                                <div class="form-group">
                                    <label for="seo_title">批注</label>
                                    <textarea class="form-control" rows="8" cols="10" id="comment"
                                              name="comment"></textarea>
                                </div>
                                <div class="form-group">
                                    <input th:each="btn:${outComeBtn}" type="submit" name="result" class="btn btn-primary" th:value="${btn}"/>
                                    &nbsp;
                                </div>
                            </div>
                            <div th:unless="${#strings.isEmpty(isCheck)}">

                            </div>
                        </div>
                    </div>

            </form>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading"></div>
        <div class="table-responsive">
            <div th:if="${comments.size()>0}">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th>时间</th>
                        <th>批注人</th>
                        <th>批注信息</th>
                    </tr>
                    </thead>
                    <tbody>

                    <tr th:each="comment:${comments}">
                        <td th:text="${#dates.format(comment.getTime(),'yyyy-MM-dd HH:mm:ss')}"></td>
                        <td th:text="${comment.getUserId()}">${comment.userId}</td>
                        <td th:text="${comment.getFullMessage()}"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div th:if="${comments.size()==0}">
                <table class="table table-striped table-hover">
                    <tr>
                        <td>暂无批注信息</td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>

</body>
</html>